package com.oocl.homework.format.processor;

import java.util.Comparator;
import java.util.List;
import java.util.Set;

import com.oocl.homework.format.analyser.DataAnalyser;
import com.oocl.homework.format.analyser.DataAnalyserImpl;
import com.oocl.homework.format.moel.Customer;
import com.oocl.homework.format.view.DataViewImpl;
import com.oocl.homework.format.view.DataView;

public class DataProcessorImpl implements DataProcessor{

	private String format;
	private List<Customer> list;
	private DataAnalyser analyser;
	private DataView view;
	public DataProcessorImpl(List<Customer> list,String format) {
		this.format=format;
		this.list=list;
		analyser=new DataAnalyserImpl(list);
		view=new DataViewImpl();
	}
	
	public StringBuilder process(Comparator<Customer> comp) {
		Set<Customer> set=analyser.analyse(comp);
		
		return view.getView(set, format);
	}
	
	

}
